<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\admin\model;

use think\Model;

class FavoriteModel extends Model
{
    protected $autoWriteTimestamp = true;//自动写入时间戳
    protected $pk = 'id';//主键，可以用get查询

    const COLLECTION = 0;//收藏
    const PRAISE     = 1;//点赞
    const BROWSE     = 2;//浏览
    const NO         = 0;//否
    const YES        = 1;//是

    //收藏点赞类型
    const TALK_TYPE     = 0;//聊吧
    const VIDEO_TYPE    = 1;//视频
    const INDEX_TYPE    = 2;//首页
    const GOODS_TYPE    = 3;//商城商品
    const ACTIVITY_TYPE = 4;//活动

    public function video()
    {
        return $this->belongsTo('VideoModel', 'relation_id');
    }

    public function home()
    {
        return $this->belongsTo('HomeModel', 'relation_id');
    }

    public function talk()
    {
        return $this->belongsTo('TalkModel', 'relation_id');
    }


}